﻿<?php

if(!defined('IN_PHPSCUP'))exit('hacking'); 
class CompanyjobApp extends BaseApp
{
    function index()
    {
		
		$TB_job = &$this->_model('companyjob'); 
				
		$data = $TB_job->show($GLOBALS['SCup']->SCup_user_msg['user_id']);	
	    
		
        $this->assign('lw_data', $data['data']);		
		$this->assign('lw_page', $data['page']); 				
					
	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('company/companyjoblist.view.html');
    }


    function add()
    {
		
	
	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('company/companyjobadd.view.html');
    }
	

    function addpost()
    {

	     $data = $_POST['data'];
         
		 $data['user_id'] = $GLOBALS['SCup']->SCup_user_msg['user_id'];
	 	 $TB_company= &$this->_model('company');		 		 		
		 $companydata = $TB_company->oneshow($GLOBALS['SCup']->SCup_user_msg['user_id']);
		 $data['company_id'] = $companydata['id'];
		 $TB_job = &$this->_model('companyjob');
		 		 		
		 $TB_job->post($data);
		 		 
		 $this->index();

    }

    function edit()
    {
		$id= intval($_GET['id']);
		
		$TB_job = &$this->_model('companyjob'); 
				
		$data = $TB_job->oneshow($id,$GLOBALS['SCup']->SCup_user_msg['user_id']);		

        $this->assign('data', $data);

        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('company/companyjobedit.view.html');
      

    }

    function editpost()
    {
		$id= intval($_POST['id']);
		
		$data = $_POST['data'];
	 	 $TB_company= &$this->_model('company');		 		 		
		 $companydata = $TB_company->oneshow($GLOBALS['SCup']->SCup_user_msg['user_id']);
		 $data['company_id'] = $companydata['id']; 
		$TB_job = &$this->_model('companyjob'); 		
				
		$TB_job->editaction($id,$data,$GLOBALS['SCup']->SCup_user_msg['user_id']);
			
		$this->index();  	      

    }
	
	

    function del()
    {
		$id= intval($_GET['id']);		

		$TB_job = &$this->_model('companyjob'); 		
		$TB_job->del($id,$GLOBALS['SCup']->SCup_user_msg['user_id']);
				      
        $this->index();    
    }	
	
   
}





?>